Imports System
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms


Public Class HatchBrushDemo

    Private Sub HatchBrushDemo_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Const iSize = 32, iMargin = 8
        Const iMin = 0, iMax = 52

        Dim hs As HatchStyle
        For hs = iMin To iMax
            Dim hbrush As New HatchBrush(hs, Color.White, Color.Black)
            Dim y As Integer = hs / 8
            Dim x As Integer = hs Mod 8

            e.Graphics.FillRectangle(hbrush, iMargin + x * (iMargin + iSize), iMargin + y * (iMargin + iSize), iSize, iSize)
        Next

    End Sub

End Class
